package com.superatom.concurrent.basic.executor;

import com.superatom.concurrent.basic.LiftOff;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class SingleThreadExecutor {

    public static void main(String[] args){
        // 创建单条线程执行所有提交的工作任务，按顺序执行
        ExecutorService exec = Executors.newSingleThreadExecutor();
        for (int i = 0; i < 5; i++){
            exec.execute(new LiftOff());
        }
        exec.shutdown();
    }
}
